In the shadow mode, thanks to recent patches, the shadow
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Tue, 18 Oct 2005 09:45:29 +0000 (10:45 +0100)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Tue, 18 Oct 2005 09:45:29 +0000 (10:45 +0100)
reference counts (both general counts and type counts)
are now correct in all of my testing so far.  As a result,
we should remove the shadow_tainted_refcnt flag from
the domain structure.  Leaving this flag in place would
create confusion for programmers and would also prevent
future debugging of problems in handling general and type
reference counts in the shadow mode.  In addition, the
patch also (1) drops the requirement that shadow_mode_disable()
should only be called in the domain destruction sequence
(even though it is only used that way so far), and
(2) strictly assert that the type reference count must
be 0 when we free a page from the dom heap.

Signed-off-by: Khoa Huynh <khoa@us.ibm.com>
xen/arch/x86/shadow32.c
xen/arch/x86/shadow_public.c
xen/common/page_alloc.c
xen/include/asm-x86/domain.h
xen/include/asm-x86/shadow.h
xen/include/xen/shadow.h

index 0b884481811b5ce33994c9ef8d58f8c454eb6c5a..18b5dc448fc7b5c9fe11d8642d37a6fd54104b03 100644 (file)
@@ -1187,14 +1187,6 @@ void __shadow_mode_disable(struct domain *d)
     if ( unlikely(!shadow_mode_enabled(d)) )
         return;
 
-    /*
-     * Currently this does not fix up page ref counts, so it is valid to call
-     * only when a domain is being destroyed.
-     */
-    BUG_ON(!test_bit(_DOMF_dying, &d->domain_flags) &&
-           shadow_mode_refcounts(d));
-    d->arch.shadow_tainted_refcnts = shadow_mode_refcounts(d);
-
     free_shadow_pages(d);
     free_writable_pte_predictions(d);
 
index 36266128df2958db2849a7528b775842d70d21c5..b27c1086f65e61c26b4518ff492995bcf5d1817b 100644 (file)
@@ -879,14 +879,6 @@ void __shadow_mode_disable(struct domain *d)
     if ( unlikely(!shadow_mode_enabled(d)) )
         return;
 
-    /*
-     * Currently this does not fix up page ref counts, so it is valid to call
-     * only when a domain is being destroyed.
-     */
-    BUG_ON(!test_bit(_DOMF_dying, &d->domain_flags) &&
-           shadow_mode_refcounts(d));
-    d->arch.shadow_tainted_refcnts = shadow_mode_refcounts(d);
-
     free_shadow_pages(d);
     free_writable_pte_predictions(d);
 
index d4ae62ee2e9d1d682b65fd3bc60971181055adeb..d2321a747eaeb7e4516a00d1d5e93592781c307c 100644 (file)
@@ -610,8 +610,7 @@ void free_domheap_pages(struct pfn_info *pg, unsigned int order)
         for ( i = 0; i < (1 << order); i++ )
         {
             shadow_drop_references(d, &pg[i]);
-            ASSERT(((pg[i].u.inuse.type_info & PGT_count_mask) == 0) ||
-                   shadow_tainted_refcnts(d));
+            ASSERT((pg[i].u.inuse.type_info & PGT_count_mask) == 0);
             pg[i].tlbflush_timestamp  = tlbflush_current_time();
             pg[i].u.free.cpumask      = d->cpumask;
             list_del(&pg[i].list);
index aece57a6c3931362978efe44d546e0649c0bdffc..fb9eff7ee4456a584921523fc504512bfd240461 100644 (file)
@@ -32,8 +32,6 @@ struct arch_domain
     struct shadow_ops *ops;
     unsigned int shadow_mode;  /* flags to control shadow table operation */
     unsigned int shadow_nest;  /* Recursive depth of shadow_lock() nesting */
-    /* Shadow mode has tainted page reference counts? */
-    unsigned int shadow_tainted_refcnts;
 
     /* shadow hashtable */
     struct shadow_status *shadow_ht;
index 3e2f3b9d6a64380699a59d465a8a68a973061f5f..93bd92aaf740a14686ece6c024856729cbb56e03 100644 (file)
@@ -55,8 +55,6 @@
 #define shadow_mode_translate(_d) ((_d)->arch.shadow_mode & SHM_translate)
 #define shadow_mode_external(_d)  ((_d)->arch.shadow_mode & SHM_external)
 
-#define shadow_tainted_refcnts(_d) ((_d)->arch.shadow_tainted_refcnts)
-
 #define shadow_linear_pg_table ((l1_pgentry_t *)SH_LINEAR_PT_VIRT_START)
 #define __shadow_linear_l2_table ((l2_pgentry_t *)(SH_LINEAR_PT_VIRT_START + \
      (SH_LINEAR_PT_VIRT_START >> (L2_PAGETABLE_SHIFT - L1_PAGETABLE_SHIFT))))
index 4248b30f80c762be54d9cacb2d3d5f6c4f51553d..a69bd59802da627cadb06f84508bfe188c5089cb 100644 (file)
@@ -12,7 +12,6 @@
 
 #define shadow_drop_references(_d, _p)          ((void)0)
 #define shadow_sync_and_drop_references(_d, _p) ((void)0)
-#define shadow_tainted_refcnts(_d)              (0)
 
 #endif